package com.run;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import org.testng.annotations.Test;
import com.client.HttpClient;
import com.util.ReadExcel;

public class RunWMSApiCase {
	
	  private static List<Map<String, String>> list;
	
	@Test
	public  void Commodity_inquiry(){
		try {
			/*
			 * 商品查询接口TestCase1
			 * 0:第一张表
			 * 1:第二行开始
			 * 1:第二行结束
			 * 4:URL地址列
			 * 8:请求报文列
			 */
			list=ReadExcel.readToExcel("G:/WMSApiCase.xlsx",0,1,1,4,8);
			for(Map<String,String> i:list){				
				HttpClient.doPostJson(i.get("URL"), i.get("BodyParam"));
				
//				for(String y:i.keySet()){
//					System.out.println(i.get(y));
//				}
			}
						
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	
	@Test
	public void Commodity_inquiry2(){
		/*
		 * 商品查询接口TestCase2
		 * 0:第一张表
		 * 2:第三行开始
		 * 2:第三行结束
		 * 4:URL地址列
		 * 8:请求报文列
		 */
		
		try {
			list = ReadExcel.readToExcel("G:/WMSApiCase.xlsx",0,2,2,4,8);
			for(Map<String,String> i:list){				
				HttpClient.doPostJson(i.get("URL"), i.get("BodyParam"));
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}
	

}
